package com.edu.smsys.controller;

import com.edu.smsys.dao.entity.StudentEntity;
import com.edu.smsys.service.impl.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/student")
public class StudentController extends BaseController {
    @Autowired
    private StudentService studentService;

    @RequestMapping("/studentlist/json")
    @ResponseBody
    public String studentListForJson(){
        List<StudentEntity> list=studentService.queryAllStudent();
        return toJsonStr(list);
    }

}
